<template>
  <div>
    <h3>我是第二个路由</h3>
  </div>
</template>

<script>
export default {
  name: "two",
  beforeRouteEnter(to, from, next) {
    console.log("当前组件被路由切换进入后进入组件就会触发");
    next();
  },
  beforeRouteUpdate(to, from, next) {
    console.log("当前路由改变");
    next();
  },
  beforeRouteLeave(to, from, next) {
    console.log("我要离开你了");
    next();
  },
};
</script>

<style>
</style>